from .commands.submit import SubmitCommand, SubmitPipeCommand
from .commands.init import InitCommand
from .commands.clear import ClearCommand
from .commands.show import ShowCommand
from .commands.monitor import MonitorCommand
from .commands.version import VersionCommand
from .commands.jobs import RemoveCommand, StopCommand, RestartCommand, PopCommand
from cleo.application import Application as BaseApp
from tjob.version import version as __version__


class Application(BaseApp):
    def __init__(self) -> None:
        super().__init__("tjob", __version__)


application = Application()
application.catch_exceptions(False)
application.add(SubmitCommand())
application.add(SubmitPipeCommand())
application.add(InitCommand())
application.add(ClearCommand())
application.add(ShowCommand())
application.add(MonitorCommand())
application.add(VersionCommand())


application.add(RemoveCommand())
application.add(RestartCommand())
application.add(StopCommand())
application.add(PopCommand())


def run():
    application.run()
